/**
 * 
 */
package optimization.randomNumberGenerator;

import optimization.IdentificationI;

/**
 * Superclass for integration of multiple random number generators.
 * 
 * @author Kevin Wagner
 * @version 1.0
 */
public abstract class RandomNumberGenerator implements IdentificationI {
	
	private long seed;
	
	/**
	 * Creates a new random number generator with a given seed.
	 * @param seed seed for the generator
	 */
	public RandomNumberGenerator(long seed){
		this.seed=seed;
	}

	/**
	 * Creates a new random value between 0 and max-1.
	 * 
	 * @param max
	 *            maximum values (exclusive)
	 * 
	 * @return next random integer value
	 */
	public abstract int nextInt(int max);

	/**
	 * Creates a new random value.
	 * 
	 * @return next random double value
	 */
	public abstract double nextDouble();

	/**
	 * Creates a new random value.
	 * 
	 * @return next random boolean value
	 */
	public abstract boolean nextBoolean();

	/**
	 * Creates a new random value.
	 * 
	 * @return next random long value
	 */
	public abstract long nextLong();

	/**
	 * Creates a new random value.
	 * 
	 * @return next random short value
	 */
	public abstract short nextShort();

	/**
	 * Creates a new normal distributed random number.
	 * 
	 * @return next normal distributed random number
	 */
	public abstract double nextGaussian();

	/**
	 * Sets the seed for the random number generator.
	 * 
	 * @param seed
	 *            seed
	 */
	public void setSeed(long seed){
		this.seed=seed;
	}

	/**
	 * Returns the current seed of the random number generator.
	 * @return current seed
	 */
	public long getSeed(){
		return seed;
	}

}
